package viscosity;

import static mathUtils.VecMath.vecScale;

import java.util.ArrayList;

import forces.FieldForce;

public class Viscosity implements FieldForce {

	public float constant = 1.0f;
	public ArrayList<Viscous> objectList;

	public Viscosity() {
		objectList = new ArrayList<Viscous>();
	}
	public Viscosity(float c) {
		objectList = new ArrayList<Viscous>();
		constant = c;
	}

	public void applyForces() {
		for (Viscous obj : objectList) {
			float f[] = obj.velocity().clone();
			vecScale(f, -constant);
			obj.takeForce(f);
		}

	}

}
